package org.dromara.oce.domain.vo;

import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;

import java.io.FileOutputStream;
import java.io.IOException;
import java.util.List;

@Data
public class OceAdvertiserDataAnalysisExcel {

    @ExcelProperty(value = "类型")
    private String thirdAdvertiserId;


    @ExcelProperty(value = "性别数据")
    private List<OceAdvertiserDataAnalysisVo> sexList;

    @ExcelProperty(value = "年龄数据")
    private List<OceAdvertiserDataAnalysisVo> ageList;

    @ExcelProperty(value = "年龄细分数据")
    private List<OceAdvertiserDataAnalysisVo> ageV2List;

    @ExcelProperty(value = "平台数据")
    private List<OceAdvertiserDataAnalysisVo> platList;

    @ExcelProperty(value = "网络数据")
    private List<OceAdvertiserDataAnalysisVo> acList;

    @ExcelProperty(value = "省份数据")
    private List<OceAdvertiserDataAnalysisVo> provinceList;

    @ExcelProperty(value = "城市数据")
    private List<OceAdvertiserDataAnalysisVo> cityList;

    @ExcelProperty(value = "首先位置数据")
    private List<OceAdvertiserDataAnalysisVo> appList;


    public static void main(String[] args) throws IOException {
        Workbook workbook = new XSSFWorkbook();
        Sheet sheet = workbook.createSheet("数据分析");

        Row headerRow = sheet.createRow(0);
        headerRow.createCell(0).setCellValue("广告主");
        headerRow.createCell(1).setCellValue("912830912830921");


        headerRow.createCell(4).setCellValue("");

        Row headerRow1 = sheet.createRow(1);
        headerRow1.createCell(0).setCellValue("年龄");
        headerRow1.createCell(6).setCellValue("区域");

        Row headerRow2 = sheet.createRow(2);
        headerRow2.createCell(0).setCellValue("年龄");
        headerRow2.createCell(1).setCellValue("消耗");
        headerRow2.createCell(2).setCellValue("展示数");
        headerRow2.createCell(3).setCellValue("千展费用");
        headerRow2.createCell(4).setCellValue("点击数");


        headerRow2.createCell(6).setCellValue("区域");
        headerRow2.createCell(7).setCellValue("消耗");
        headerRow2.createCell(8).setCellValue("展示数");
        headerRow2.createCell(9).setCellValue("千展费用");
        headerRow2.createCell(10).setCellValue("点击数");

        try (FileOutputStream outputStream = new FileOutputStream("C:\\Users\\hhl\\Desktop\\test\\aaa.xlsx")) {
            workbook.write(outputStream);
        }
        workbook.close();
    }

}
